class Service < ActiveRecord::Base
  
  acts_as_annotatable
  
  validates_presence_of :name, :endpoint_url, :message => "for service can't be blank"
  
  validates_uniqueness_of :biocat_link, :allow_nil => true
  
  validates_format_of :endpoint_url, 
                      :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix, 
                      :message => "not valid"
end
